from models import db, Bill
from app import app

with app.app_context():
    latest = Bill.query.order_by(Bill.date.desc()).first()
    if latest:
        print(f'最新账单日期: {latest.date}')
    else:
        print('无账单数据')